package com.example.javabase.multithread.readwritelock;

/**
 * @author He Changjie on 2021/7/11
 */
public class Main {
    public static void main(String[] args) {
        RWDictionary dictionary = new RWDictionary();
        WriteTask writeTask = new WriteTask(dictionary);
        ReadTask readTask = new ReadTask(dictionary);

        Thread writeThread0 = new Thread(writeTask);
        Thread writeThread1 = new Thread(writeTask);
        Thread writeThread2 = new Thread(writeTask);

        Thread readThread0 = new Thread(readTask);
        Thread readThread1 = new Thread(readTask);
        Thread readThread2 = new Thread(readTask);
        writeThread0.start();
        writeThread1.start();
        writeThread2.start();
        readThread0.start();
        readThread1.start();
        readThread2.start();
    }
}
